package com.mvu.banana.tools;

import com.mvu.banana.gwttest.client.ClientTestBase;
import com.mvu.banana.gwttest.generated.WidgetsTest;

/**
 */
public class ClientTestGenerator extends CodeGenerator{
  public static void main(String[] args) {
    genTest(CodeGenerator.composites);
  }

  public static void genTest(Class[] composites) {
    JavaClass javaClass = new JavaClass().withName(WidgetsTest.class.getName())
      .withSuperClass(ClientTestBase.class);
    for(Class c : composites){
      JavaMethod javaMethod = javaClass.addMethod(false, "void", "test" + c.getSimpleName());
      javaClass.importClass(c);
      javaMethod.addLine("new ", c.getSimpleName(), "()");
    }
    logger.info(javaClass.print());
    javaClass.writeToTestFolder(true);
  }
}
